<?php
include_once ('class/autoload.php'); // pour inclure nos classes
include_once ('class/config.inc.php');

$site = new page_securisee ( 'AjoutTicket', "Ajouter un ticket", "" );

if (! isset ( $_POST ["commentaire"] )) {
	
	$corps =  retourne_form_ajout () ;	
	$site->corps = $corps;
} else if (! empty ( $_POST ["commentaire"] ) && ! empty ( $_POST ["problematique"] ) && ! empty ( $_POST ["idClient"] ) && isset ( $_POST ["Cloture"] )) {
	$site->corps = ajout_Ticket ();
} else {
	$corps = "Il manque des informations pour l'enregistrement du ticket
			";
	$corps .= '<br><a href="AjoutTicket.php"> <input type="button" class="btn btn-large btn-primary" value="Nouveau Ticket">  </a><a href="AccueilConnecter.php"> <input type="button" class="btn btn-large btn-primary" value="Accueil">  </a>';
	$site->corps = $corps;
}

$site->affiche ();
?>